package com.changpei.search.controller;

import com.changpei.common.result.Result;
import com.changpei.search.service.HomeIndexService;
import com.changpei.search.vo.HomeIndexVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author Way on 2021/9/22
 */
@RestController
@RequestMapping("/homeIndex")
@CrossOrigin
public class HomeIndexController {

    @Autowired
    private HomeIndexService homeIndexService;

    /**
     * 首页数据
     * @param map
     * @return
     */
    @PostMapping
    public Result<List<HomeIndexVO>> home(@RequestBody Map<String, Object> map) {
        List<HomeIndexVO> result = homeIndexService.home(map);
        return Result.ok(result);
    }

}
